#!/usr/bin/python3

# dict = {} #声明一个空字典
# dict['one'] = "1 - 菜鸟教程" #为声明的字典赋值
# dict[2] = "2 - 菜鸟工具" #为声明的字典赋值

# tinydict = {'name':'runoob','code':1,'site':'www.runoob.com'} #声明字典并赋值

# print(dict['one'])
# print(dict[2])
# print(tinydict)
# print(tinydict.keys()) #打印所有的键
# print(tinydict.values()) #打印所有的值

dict = dict([('Runoob',1),('Google',2),('Taobao',3)])
print(dict)

dict1 = {x: x**2 for x in (2,4,6)}
print(dict1)

dict(Runoob=1,Google=2,Taobao=3)


